package com.dgshanger.sanhxiaofeisc.adapter

import android.view.View
import com.dgshanger.sanhxiaofeisc.R
import com.dgshanger.sanhxiaofeisc.entity.PersonalItemEntity
import com.xx.baseuilibrary.adapter.BaseRecycleAdapter
import com.xx.baseuilibrary.adapter.BaseViewHolder
import kotlinx.android.synthetic.main.item_person_center.view.*


/**
 * PersonItemAdapter
 * 沉迷学习不能自拔
 * Describe：
 * Created by 雷小星🍀 on 2018/4/12 16:43.
 */
class PersonItemAdapter : BaseRecycleAdapter<PersonalItemEntity, PersonItemAdapter.ViewHolder>() {

    override fun createViewHolder(view: View, viewType: Int): ViewHolder = ViewHolder(view)

    override fun getItemLayout(viewType: Int): Int = R.layout.item_person_center

    class ViewHolder(view: View) : BaseViewHolder<PersonalItemEntity>(view) {
        override fun bindView(position: Int, entity: PersonalItemEntity?) {
            itemView.iv_item_icon.setImageResource(entity!!.iconRes)
            itemView.tv_item_title.text = entity.title
        }

    }
}